<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class obat_analisa extends CI_Controller {

	public function __construct(){
		parent::__construct();
		$this->load->model('m_obat_analisa');
		$this->load->library('breadcrumb');	
	}

	public function index(){
		$this->rule->type('R');
		$judul = "Analisa Obat";
		$data['judul'] = $judul;
		$this->layout->set_title($judul);
		$this->layout->set_desc("lorem ipsum");

		#breadcrumbs
		$this->breadcrumb->clear();
		$this->breadcrumb->add_crumb('Dasbor', site_url('dasbor'));
		$this->breadcrumb->add_crumb('Obat', site_url('obat_kelompok#'));
		$this->breadcrumb->add_crumb($judul);


		$this->layout->set_include('css', 'themes/apotek/css/olide-custom.css');
		$this->layout->set_include('js', 'themes/apotek/js/olide-custom.js', 'header');
		$this->layout->set_include('js', 'themes/general/bundle/jquery_validation/jquery.validate.min.js', 'header');
		$this->layout->set_include('js', 'themes/general/bundle/jquery_validation/jquery.validate.min.js', 'header');
		$this->layout->set_include('js', 'themes/general/bundle/jquery_validation/localization/messages_id.min.js', 'header');
		$this->layout->set_include('js', 'themes/general/bundle/select2/select2.min.js', 'header');
		$this->layout->set_include('css', 'themes/general/bundle/select2/select2.min.css');

		//untuk motong kalimat
		$this->load->helper('trim_text');
		$data['obat'] = $this->m_obat_analisa->get_all();
		$this->layout->theme('apotek', 'obat_analisa/index', $data);		
	}

	public function analize(){
		$data['data'] = $this->input->post();		

		if($data['data']['btn_analize'] != ""){
			$this->rule->type('R');
			$judul = "Hasil Analisa Obat";
			$data['judul'] = $judul;
			$this->layout->set_title($judul);
			$this->layout->set_desc("lorem ipsum");

		#breadcrumbs
			$this->breadcrumb->clear();
			$this->breadcrumb->add_crumb('Dasbor', site_url('dasbor'));
			$this->breadcrumb->add_crumb('Obat', site_url('obat_analisa#'));
			$this->breadcrumb->add_crumb('Analisa Obat', site_url('obat_analisa'));
			$this->breadcrumb->add_crumb($judul);

			$this->layout->set_include('css', 'themes/apotek/css/olide-custom.css');
			$this->layout->theme('apotek', 'obat_analisa/proses', $data);		
		}else{
			redirect('obat_analisa', 'refresh');
		}
	}
}

/* End of file obat_analisa.php */
/* Location: ./application/controllers/obat_analisa.php */